# -*- coding: utf-8 -*-

import sqlite3
from my_sqlite3 import my_sqlite3_class

conn = sqlite3.connect('test.db')

print("open db succceed!")

cursor = conn.cursor()

ret = cursor.execute("select * from test")

for row in cursor:
    print("id = ", row[0])
    print("name = ", row[1])
    print("address = ", row[2], "\n")

print("select succeed!")
conn.close()



obj_sqlite = my_sqlite3_class.MySqlite3("test.db")

obj_sqlite.connect("test1.db")

result = obj_sqlite.query("select * from test")

if result is not None:
    for row in result:
        print("id = ", row[0])
        print("name = ", row[1])
        print("address = ", row[2], "\n")
else:
    print("result is None!")

obj_sqlite.close()
